/*
 *  $Id: GryphonTemple.cs 1051 2010-05-18 22:10:41Z thenn.erannor $
 *  This file is a part of Ragima CCG.
 *  (C) 2008 Ragima development group.
 *
 *  Licensed under the terms of the GNU GPL License version 2.
 *
 */

namespace Ragima.Cards001.Air.Lands {
    public class GryphonTemple: LandCard {
        public GryphonTemple(): base("001_a_l_gryphon_temple") {
            Level = CompleteLevel.ReadyForTest;
            Element = ElementType.Air;
            Value = 100;
            AddManaCost(ElementType.Air, 2);
        }
        public override void SetNaturalAffects(ICollector<Affect> affects) {
            affects.Add(new Affects.ManaIncome(ElementType.Air, 3));
        }

        public abstract class GryphonPackAura: PackAuraAffect {
            public GryphonPackAura(): base(RaceManager.GetRace<Races.Gryphon>()) {}

            protected override bool IsEnabledAura() {
                Player owner = Owner.Owner;
                return owner.Lands.Exists(IsGryphonTemple) || owner.Enemy.Lands.Exists(IsGryphonTemple);
            }

            private static bool IsGryphonTemple(Land land) {
                return land.Card is GryphonTemple;
            }
        }
    }
}
